home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / SAT / SATminimal ƒ / SATminimal.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-26  |  1.4 KB  |  60 lines  |  [TEXT/KAHL]

  1. #include "SAT.h"
  2.  
  3. /* program SATminimal; */
  4.  
  5. /* MySprite's interface */
  6. extern void InitMySprite();
  7. extern pascal void SetupMySprite (SpritePtr);
  8. extern pascal void HandleMySprite (SpritePtr);
  9.  
  10. main()
  11. {
  12.         SpritePtr ignoreSp;
  13.         long L;
  14.  
  15. /* ThinkC doesn't initialize automatically, so we must do that ourselves? */
  16.  
  17.     MaxApplZone ();
  18.     FlushEvents (everyEvent - diskMask, 0 );
  19.     InitGraf (&thePort);
  20.     InitFonts ();
  21.     InitWindows ();
  22.     InitMenus ();
  23.     TEInit ();
  24.     InitDialogs (nil);        /* no restart proc */
  25.     InitCursor ();
  26.  
  27.     MoreMasters ();
  28.     MoreMasters ();
  29.  
  30.  
  31. /* End of initializations */
  32.  
  33.     InitSAT(128, 129, 512, 322);
  34.  
  35.     InitMySprite(); /* Preload sprite data */
  36.  
  37.     ShowWindow(gSAT.wind);
  38.     SelectWindow(gSAT.wind); /* Show the window (SATwind and gameWind are the same) */
  39.  
  40.     PeekOffscreen(); /* Update the window */
  41.  
  42. /* Make a few sprites */
  43.     ignoreSp = NewSprite(0, 50, 50, SetupMySprite);
  44.     ignoreSp = NewSprite(0, 100, 100, SetupMySprite);
  45.     ignoreSp = NewSprite(0, 125, 120, SetupMySprite);
  46.     ignoreSp = NewSprite(0, 150, 140, SetupMySprite);
  47.     ignoreSp = NewSprite(0, 200, 180, SetupMySprite);
  48.     ignoreSp = NewSprite(0, 250, 200, SetupMySprite);
  49.     ignoreSp = NewSprite(0, 300, 250, SetupMySprite);
  50.  
  51.     while (!Button())
  52.     {
  53.         L = TickCount();
  54.         RunSAT(true); /* Run the animation */
  55.         while (L > TickCount() - 2L) /* Speed limit */
  56.             ;
  57.     }
  58.     SATSoundShutup(); /* Always make sure the channel is de-allocated */
  59. }
  60.